package com.practice.demo;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
@RequestMapping("/messageDemo")
@RestController
public class MessageDemo {
    public List<MessageInfo> messageInfoList=new ArrayList<>();
    @RequestMapping(value = "/message",method = RequestMethod.POST)
    public Boolean message(@RequestBody MessageInfo messageInfo){
        messageInfoList.add(messageInfo);
        return true;
    }
    @RequestMapping("/getList")
    public  List<MessageInfo> getList(){
        return  messageInfoList;
    }
}
